export const grid = {
  left: "10%",
  top: 60,
  right: "10%",
  bottom: 60,
};

export const legend = {
  show: true,
};

export const tooltip = {
  show: false,
  confine: true,
  extraCssText: "max-width:300px; white-space:pre-wrap; word-break:break-all",
};

export const xAxis = {
  show: true,
  name: "",
  type: "category",
  // 坐标轴线
  axisLine: {
    show: true,
    lineStyle: {
      color: "#cccccc",
    },
  },
  // 坐标轴刻度
  axisTick: {
    show: false,
    lineStyle: {
      color: "#cccccc",
    },
  },
  // 坐标轴标签
  axisLabel: {
    show: true,
    rotate: 0,
    hideOverlap: true,
    color: "#909399",
    fontSize: 12,
  },
  // 分隔线
  splitLine: {
    show: false,
    lineStyle: {
      color: "#eeeeee",
      type: "dashed",
    },
  },
};

export const yAxis = {
  show: true,
  type: "value",
  name: "",
  minInterval: 1,
  // 坐标轴线
  axisLine: {
    show: false,
    lineStyle: {
      color: "#cccccc",
    },
  },
  // 坐标轴刻度
  axisTick: {
    show: false,
    lineStyle: {
      color: "#cccccc",
    },
  },
  // 坐标轴标签
  axisLabel: {
    show: true,
    rotate: 0,
    hideOverlap: true,
    color: "#909399",
    fontSize: 12,
  },
  // 分隔线
  splitLine: {
    show: true,
    lineStyle: {
      color: "#eeeeee",
      type: "dashed",
    },
  },
};
export const yAxisMultiaxis = [
  {
    show: true,
    type: "value",
    name: "",
    minInterval: 1,
    axisLabel: {
      show: true,
      rotate: 0,
      hideOverlap: true,
      color: "#909399",
      fontSize: 12,
    },
    // 分隔线
    splitLine: {
      show: true,
      lineStyle: {
        color: "#eeeeee",
        type: "dashed",
      },
    },
    // 坐标轴线
    axisLine: {
      show: false,
      lineStyle: {
        color: "#cccccc",
      },
    },
    // 坐标轴刻度
    axisTick: {
      show: false,
      lineStyle: {
        color: "#cccccc",
      },
    },
  },
  {
    show: true,
    type: "value",
    name: "",
    axisLabel: {
      show: true,
      rotate: 0,
      hideOverlap: true,
      color: "#909399",
      fontSize: 12,
    },
    // 分隔线
    splitLine: {
      show: true,
      lineStyle: {
        color: "#eeeeee",
        type: "dashed",
      },
    },
    // 坐标轴线
    axisLine: {
      show: false,
      lineStyle: {
        color: "#cccccc",
      },
    },
    // 坐标轴刻度
    axisTick: {
      show: false,
      lineStyle: {
        color: "#cccccc",
      },
    },
  },
];
export const pieSeriesLabel = {
  show: false,
  position: "outside",
  color: "#fff",
  fontSize: "16px",
};

export const pieSeriesLabelLine = {
  show: false,
  smooth: false,
  lineStyle: {
    width: 1,
    type: "solid",
  },
};

export const lineSeries = {
  symbol: "emptyCircle",
  symbolSize: 4,
  smooth: true,
};

export const lineSeriesLabel = {
  show: false,
};

export const barSeries = {
  barMaxWidth: 60,
  barMinWidth: 1,
};

export const barSeriesLabel = {
  show: false,
};

export const gridConfig = [
  {
    label: "网格配置",
    bindKeys: "_group.grid",
    controlType: "group",
    controlValue: "",
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "左边距",
    bindKeys: "option.grid.left",
    controlType: "input",
    controlValue: "80",
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "上边距",
    bindKeys: "option.grid.top",
    controlType: "input",
    controlValue: "60",
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "右边距",
    bindKeys: "option.grid.right",
    controlType: "input",
    controlValue: "10%",
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "下边距",
    bindKeys: "option.grid.bottom",
    controlType: "input",
    controlValue: "60",
    controlProps: {},
    controlConfigs: {},
  },
];

export const legendConfig = [
  {
    label: "图例配置",
    bindKeys: "_group.legend",
    controlType: "group",
    controlValue: "",
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "显示",
    bindKeys: "option.legend.show",
    controlType: "switch",
    controlValue: true,
    controlProps: {},
    controlConfigs: {},
  },
];

export const tooltipConfig = [
  {
    label: "提示框配置",
    bindKeys: "_group.tooltip",
    controlType: "group",
    controlValue: "",
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "显示",
    bindKeys: "option.tooltip.show",
    controlType: "switch",
    controlValue: true,
    controlProps: {},
    controlConfigs: {},
  },
];

export const xAxisConfig = [
  {
    label: "类目轴配置",
    bindKeys: "_group.xAxis",
    controlType: "group",
    controlValue: "",
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "名称",
    bindKeys: "option.xAxis.name",
    controlType: "input",
    controlValue: "",
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "轴线显示",
    bindKeys: "option.xAxis.axisLine.show",
    controlType: "switch",
    controlValue: true,
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "轴线颜色",
    bindKeys: "option.xAxis.axisLine.lineStyle.color",
    controlType: "color-picker",
    controlValue: "#ccc",
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "刻度显示",
    bindKeys: "option.xAxis.axisTick.show",
    controlType: "switch",
    controlValue: false,
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "刻度颜色",
    bindKeys: "option.xAxis.axisTick.lineStyle.color",
    controlType: "color-picker",
    controlValue: "#ccc",
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "标签显示",
    bindKeys: "option.xAxis.axisLabel.show",
    controlType: "switch",
    controlValue: true,
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "标签角度",
    bindKeys: "option.xAxis.axisLabel.rotate",
    controlType: "slider",
    controlValue: 0,
    controlProps: {
      min: -90,
      max: 90,
      step: 5,
    },
    controlConfigs: {},
  },
  {
    label: "标签长度",
    bindKeys: "config.xAxisConfig.font.length",
    controlType: "input-number",
    controlValue: 10,
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "隐藏重叠标签",
    bindKeys: "option.xAxis.axisLabel.hideOverlap",
    controlType: "switch",
    controlValue: true,
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "标签颜色",
    bindKeys: "option.xAxis.axisLabel.color",
    controlType: "color-picker",
    controlValue: "#909399",
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "标签大小",
    bindKeys: "option.xAxis.axisLabel.fontSize",
    controlType: "input-number",
    controlValue: 12,
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "分割线显示",
    bindKeys: "option.xAxis.splitLine.show",
    controlType: "switch",
    controlValue: false,
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "分割线颜色",
    bindKeys: "option.xAxis.splitLine.lineStyle.color",
    controlType: "color-picker",
    controlValue: "#eee",
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "分割线类型",
    bindKeys: "option.xAxis.splitLine.lineStyle.type",
    controlType: "select",
    controlValue: "dashed",
    controlProps: {},
    controlConfigs: {
      options: [
        {
          label: "实线",
          value: "solid",
        },
        {
          label: "虚线",
          value: "dashed",
        },
      ],
    },
  },
];

export const yAxisConfig = [
  {
    label: "数值轴配置",
    bindKeys: "_group.yAxis",
    controlType: "group",
    controlValue: "",
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "名称",
    bindKeys: "option.yAxis.name",
    controlType: "input",
    controlValue: "",
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "轴线显示",
    bindKeys: "option.yAxis.axisLine.show",
    controlType: "switch",
    controlValue: false,
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "轴线颜色",
    bindKeys: "option.yAxis.axisLine.lineStyle.color",
    controlType: "color-picker",
    controlValue: "#ccc",
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "刻度显示",
    bindKeys: "option.yAxis.axisTick.show",
    controlType: "switch",
    controlValue: false,
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "刻度颜色",
    bindKeys: "option.yAxis.axisTick.lineStyle.color",
    controlType: "color-picker",
    controlValue: "#ccc",
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "标签显示",
    bindKeys: "option.yAxis.axisLabel.show",
    controlType: "switch",
    controlValue: true,
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "标签角度",
    bindKeys: "option.yAxis.axisLabel.rotate",
    controlType: "slider",
    controlValue: 0,
    controlProps: {
      min: -90,
      max: 90,
      step: 5,
    },
    controlConfigs: {},
  },
  {
    label: "隐藏重叠标签",
    bindKeys: "option.yAxis.axisLabel.hideOverlap",
    controlType: "switch",
    controlValue: true,
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "标签颜色",
    bindKeys: "option.yAxis.axisLabel.color",
    controlType: "color-picker",
    controlValue: "#909399",
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "标签大小",
    bindKeys: "option.yAxis.axisLabel.fontSize",
    controlType: "input-number",
    controlValue: 12,
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "分割线显示",
    bindKeys: "option.yAxis.splitLine.show",
    controlType: "switch",
    controlValue: true,
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "分割线颜色",
    bindKeys: "option.yAxis.splitLine.lineStyle.color",
    controlType: "color-picker",
    controlValue: "#eee",
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "分割线类型",
    bindKeys: "option.yAxis.splitLine.lineStyle.type",
    controlType: "select",
    controlValue: "dashed",
    controlProps: {},
    controlConfigs: {
      options: [
        {
          label: "实线",
          value: "solid",
        },
        {
          label: "虚线",
          value: "dashed",
        },
      ],
    },
  },
];

export const pieSeriesLabelConfig = [
  {
    label: "标签配置",
    bindKeys: "_group.pie.series.label",
    controlType: "group",
    controlValue: "",
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "显示",
    bindKeys: "series.label.show",
    controlType: "switch",
    controlValue: false,
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "位置",
    bindKeys: "series.label.position",
    controlType: "select",
    controlValue: "outside",
    controlProps: {},
    controlConfigs: {
      options: [
        {
          label: "饼图扇区外侧",
          value: "outside",
        },
        {
          label: "饼图扇区内部",
          value: "inside",
        },
      ],
    },
  },
  {
    label: "颜色",
    bindKeys: "series.label.color",
    controlType: "color-picker",
    controlValue: "#606266",
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "文字大小",
    bindKeys: "series.label.fontSize",
    controlType: "input",
    controlValue: "12px",
    controlProps: {},
    controlConfigs: {},
  },
];

export const pieSeriesLabelLineConfig = [
  {
    label: "标签引线配置",
    bindKeys: "_group.pie.series.labelLine",
    controlType: "group",
    controlValue: "",
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "显示",
    bindKeys: "series.labelLine.show",
    controlType: "switch",
    controlValue: false,
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "平滑显示",
    bindKeys: "series.labelLine.smooth",
    controlType: "switch",
    controlValue: false,
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "线宽",
    bindKeys: "series.labelLine.lineStyle.width",
    controlType: "input-number",
    controlValue: 1,
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "类型",
    bindKeys: "series.labelLine.lineStyle.type",
    controlType: "select",
    controlValue: "solid",
    controlProps: {},
    controlConfigs: {
      options: [
        {
          label: "实线",
          value: "solid",
        },
        {
          label: "虚线",
          value: "dashed",
        },
      ],
    },
  },
];

export const lineSeriesConfig = [
  {
    label: "标记配置",
    bindKeys: "_group.line.series.symbol",
    controlType: "group",
    controlValue: "",
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "图形",
    bindKeys: "series.symbol",
    controlType: "select",
    controlValue: "emptyCircle",
    controlProps: {},
    controlConfigs: {
      options: [
        {
          label: "空心圆",
          value: "emptyCircle",
        },
        {
          label: "圆",
          value: "circle",
        },
        {
          label: "矩形",
          value: "rect",
        },
        {
          label: "圆角矩形",
          value: "roundRect",
        },
        {
          label: "三角形",
          value: "triangle",
        },
        {
          label: "钻石",
          value: "diamond",
        },
        {
          label: "箭头",
          value: "arrow",
        },
      ],
    },
  },
  {
    label: "大小",
    bindKeys: "series.symbolSize",
    controlType: "input-number",
    controlValue: 4,
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "折线配置",
    bindKeys: "_group.line.series.line",
    controlType: "group",
    controlValue: "",
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "平滑显示",
    bindKeys: "series.smooth",
    controlType: "switch",
    controlValue: true,
    controlProps: {},
    controlConfigs: {},
  },
];

export const lineSeriesLabelConfig = [
  {
    label: "标签配置",
    bindKeys: "_group.line.series.label",
    controlType: "group",
    controlValue: "",
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "显示",
    bindKeys: "series.label.show",
    controlType: "switch",
    controlValue: false,
    controlProps: {},
    controlConfigs: {},
  },
];

export const barSeriesConfig = [
  {
    label: "柱条配置",
    bindKeys: "_group.bar.series",
    controlType: "group",
    controlValue: "",
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "最大宽度",
    bindKeys: "series.barMaxWidth",
    controlType: "input-number",
    controlValue: 40,
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "最小宽度",
    bindKeys: "series.barMinWidth",
    controlType: "input-number",
    controlValue: 1,
    controlProps: {},
    controlConfigs: {},
  },
];

export const barSeriesLabelConfig = [
  {
    label: "标签配置",
    bindKeys: "_group.bar.series.label",
    controlType: "group",
    controlValue: "",
    controlProps: {},
    controlConfigs: {},
  },
  {
    label: "显示",
    bindKeys: "series.label.show",
    controlType: "switch",
    controlValue: false,
    controlProps: {},
    controlConfigs: {},
  },
];
